/*
 * @Author: your name
 * @Date: 2020-07-24 10:26:51
 * @LastEditTime: 2020-07-24 15:16:51
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \tinkjsDemo\src\controller\kmlc\auth.js
 */ 

 export default class extends think.BaseController{
    
    async loginAction(){//根据父id获取所有子部门
        let aj = {};
       
        const username = ['admin', 'super']
        // 强硬要求 ant.design admin 相同密码
        // '21232f297a57a5a743894a0e4a801fc3',
        const password = ['21232f297a57a5a743894a0e4a801fc3','8914de686ab28dc22f30d3d8e107ff6c'] // admin, ant.design

        const body = this.post()
        console.log('mock: body', body)
        if (!username.includes(body.username) || !password.includes(body.password)) {
            return this.errorJson({ isLogin: true }, '账户或密码错误', 401)
        }
        
         this.successJson({ 
            'id': 'id',
            'name': 'name',
            'username': 'admin',
            'password': '',
            'avatar': 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
            'status': 1,
            'telephone': '',
            'lastLoginIp': '27.154.74.117',
            'lastLoginTime': 1534837621348,
            'creatorId': 'admin',
            'createTime': 1497160610259,
            'deleted': 0,
            'roleId': 'admin',
            'lang': 'zh-CN',
            'token': '4291d7da9005377ec9aec4a71ea837f'
          })

    }
 }